/*
 *  Universe.h
 *  SpaceTrader
 *
 *  Created by Andrew on 10/16/12.
 *  Copyright 2012 The Hex Pistols. All rights reserved.
 *
 */

#include <string>
#include <cstdlib>
#include "Planet.h"
#include "System.h"
#include "Market.h"
#include <vector>
#include "boost/archive/text_oarchive.hpp"
#include "boost/archive/text_iarchive.hpp"
#include <fstream>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/split_member.hpp>
#pragma once


class Universe {
	
private:
    friend class boost::serialization::access;
    std::vector<System*> systems;
    template<class Archive>
    void save(Archive & ar, const unsigned int version) const
    {
        //serialization
        //ar << systems;
        for (int i = 0; i < 3; i++){
            ar << systems[i];
        }
    }
    template<class Archive>
    void load(Archive & ar, const unsigned int version)
    {
        systems = *new std::vector<System*>();
        while (systems.size() < 3){
            System *system;
            ar >> system;
            if (system != NULL){
                systems.push_back(system);
            }
        }
    }
    BOOST_SERIALIZATION_SPLIT_MEMBER();
	
public:
    Universe();
	Universe(Market *market);
	~Universe();
	std::vector<System*> getSystems();
};
/*
 "Artemis Tau";
 "Attican Beta";
 "Exodus Cluster";
 "Gemini Sigma";
 "Hades Gamma";
 "Hawking Eta";
 "Horse Head Nebula";
 "Kepler Verge";
 "Sol";
 "Maroon Sea";
 "Pangea Expanse";
 "Serpent Nebula";
 "Styx Theta";
 "Voyager Cluster";
 */
